Skip to content

Standardize datetime handling#124

Merged
arjunkomath merged 1 commit into
mainfrom
codex/standardize-datetime
Jul 10, 2026
Merged

Standardize datetime handling#124
arjunkomath merged 1 commit into
mainfrom
codex/standardize-datetime

Conversation

@techulus-agent

Copy link
Copy Markdown
Collaborator

Summary

  • expand the shared date library into the single API for display formats, parsing, relative time, elapsed durations, comparisons, expiry checks, and date arithmetic
  • replace component-local formatters and duplicated duration helpers across settings, logs, metrics, backups, builds, and rollouts
  • standardize server-side expiry, threshold, retention, scheduling, and metrics-window calculations
  • add a hydration-safe local date component so server-rendered timestamps switch to the viewer timezone without React hydration mismatches
  • validate agent timestamps and backup retention configuration before date arithmetic

Why

Datetime behavior was split across local helpers, direct Intl and Date calls, and repeated timestamp arithmetic. This produced inconsistent formats, timezone-sensitive server output, duplicated logic, and edge cases around invalid or out-of-range timestamps.

This change keeps persistence timestamps and protocol ISO serialization explicit while routing application-level date behavior through one shared module.

Basecamp: https://app.basecamp.com/5890597/buckets/47439993/todos/10081400176

Impact

  • UI dates use the shared en-US, 24-hour format contract in the viewer local timezone
  • server-generated alert timestamps use explicit UTC
  • expiry checks fail closed on invalid data
  • elapsed and UTC calendar operations are named and tested separately
  • no new runtime dependencies were added

Review

  • completed a full self-review and addressed naming, fail-closed expiry, and rendering issues
  • completed Claude Opus smart review and follow-up review
  • fixed the unauthenticated agent timestamp overflow path, date arithmetic overflow validation, hydration-safe rendering, configuration bounds, and review follow-ups

Validation

  • Biome check on all 33 changed files
  • TypeScript: tsc --noEmit
  • Vitest: 17 files, 81 tests
  • Next.js 16 production build

@github-actions

Copy link
Copy Markdown

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit 3295595.

@arjunkomath arjunkomath marked this pull request as ready for review July 10, 2026 08:08
@arjunkomath arjunkomath merged commit eb0b64d into main Jul 10, 2026
9 checks passed
@arjunkomath arjunkomath deleted the codex/standardize-datetime branch July 10, 2026 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants